import NProgress from 'nprogress'
import type { UserModule } from './types'

export const install: UserModule = ({router,isClient}) => {
    if (isClient) {
        NProgress.inc(0.1); //递增进度条
        NProgress.configure({
            easing: "ease",
            speed: 3000,
            // showSpinner: true
            showSpinner: false
        });
        // router.beforeEach(() => { NProgress.start() })
        router.beforeEach(() => { NProgress.start() })
        router.afterEach(() => { NProgress.done() })
    }
}
